package cloud.xlh.infrastructure.utils.file_breakpoint_continuation;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/6/26 12:51
 * @ Description:
 */
public class BigDataHandleUtil {
    /**
     *
     * @param list
     * @param index
     * @param pageSize
     * @return java.util.List<java.lang.Object>
     * @author XuLeHuang
     * @create 2023/6/26
     * @name:
     * @Description: 循环次数：int pages = (int) Math.ceil(list.size() * 1.0 / pageSize);
     **/
    public static List<Object> batch(List<Object> list , Integer index , Integer pageSize) {
        return list.stream().skip((index - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
    }
}
